package com.example.demo.quartz.job;


import cn.hutool.extra.spring.SpringUtil;
import com.example.demo.forest.HttpInterface;
import com.example.demo.forest.response.TuWeiResponse;
import com.example.demo.music.TtsMusicUtil;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/*
 *
 *   @Author:Sjy
 *   @Date: 2024/4/12-04-12-9:28
 *   定时给我女朋友发邮件 + 土味情话接口 = 沸羊羊
 */
@Slf4j
@Component
public class CallMyGirlFriendsJob implements Job {



    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        //具体执行的内容
        log.info("啊你嘎多美羊羊");
        //hutool ioc 注入ttsMusicUtil
        TtsMusicUtil ttsMusicUtil = SpringUtil.getBean("ttsMusicUtil");

        HttpInterface httpInterface = SpringUtil.getBean("httpInterface");
        TuWeiResponse tuWei = httpInterface.getTuWei();

        ttsMusicUtil.syntheticAudio(tuWei.getContent());
    }
}
